<?php

namespace app\store\controller\zzindb;

use alibabasdk\AlibabaClient;
use alibabasdk\AlibabaException;
use think\Config;
use think\Db;
use think\Request;
use think\View;

class Aliajaxgetgoods extends \think\Controller
{
    //此类做测试，已经无需使用作废了
    const wxapp_id = 10016;
    public $request;
    public function _initialize(Request $request = null){
        $this->request = is_null($request) ? Request::instance() : $request;
    }
    public function getOldData($api, $params){
        $back = false;
        $client = new AlibabaClient(5788670, 'Vy2mVRJVN4TQ', 'ef3ffc60-6ccf-4cb1-bed6-9f772da99d84');
        try {
            $res = $client->post($api,$params); // post
            $back = $res;
            //dump($res);
            // $client->get($api,$params);  // get
        }catch (AlibabaException $e){
            echo $e->getMessage();
        }
        return $back;
    }
}
